function tabBar1(){
	location.href="./index.html"
}
function tabBar2(){
	location.href="./searchList.html"
}
function tabBar3(){
	location.href="./news.html"
}
function tabBar4(){
	location.href="./userInfo.html"
}
function GetQueryString(name) {  
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");  
    var r = window.location.search.substr(1).match(reg);  //获取url中"?"符后的字符串并正则匹配
    var context = "";  
    if(r != null){
        context = r[2];
    }
    reg = null;  
    r = null;  
    return context == null || context == "" || context == "undefined" ? "" : context;  
}

/**
 * [isMobile 判断平台]
 * @param test: 0:iPhone    1:Android
 */
function ismobile(test){
    var u = navigator.userAgent, app = navigator.appVersion;
    if(/AppleWebKit.*Mobile/i.test(navigator.userAgent) || (/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(navigator.userAgent))){
     if(window.location.href.indexOf("?mobile")<0){
      try{
       if(/iPhone|mac|iPod|iPad/i.test(navigator.userAgent)){
        return '0';
       }else{
        return '1';
       }
      }catch(e){}
     }
    }else if( u.indexOf('iPad') > -1){
        return '0';
    }else{
        return '1';
    }
};

//原生那边调用的关闭页当前页面的方法
function closePage(){
	console.log(" enter closePage method...");
	WebViewJavascriptBridge.callHandler(
		'close'
		, {}
		, function(responseData) {
		}
	);
}
//从localstorage 返回给原生
function getUserFromH5(){
	console.log(" enter getUserFromH5 method...");
	var uid = window.localStorage.uid;
	var token = window.localStorage.token;
	WebViewJavascriptBridge.callHandler(
			'getUserFromH5'
			, {
				'uid' : uid,
				'token' : token
			}
			, function(responseData) {
				
			}
		);
}

